package com.souku.finance.application.ui.more;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.souku.finance.application.R;
import com.souku.finance.application.base.BaseActivity;
import com.souku.finance.application.utils.Constant;
import com.souku.finance.application.utils.ShareUtil;

/**
 * Created by Android on 2016/12/22.
 */

public class BankCardActivity extends BaseActivity implements View.OnClickListener {

    protected RelativeLayout topBack;
    protected TextView topTitle;
    protected Button btnGotobind;
    protected LinearLayout llNobind;
    protected LinearLayout llBind;

    @Override
    public void internet() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.act_bankcard);
        initView();
        topTitle.setText("我的银行卡");
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (ShareUtil.getInstance().getString(Constant.IsBind).equals("1")) {
            llBind.setVisibility(View.VISIBLE);
            llNobind.setVisibility(View.GONE);
        } else {
            llBind.setVisibility(View.GONE);
            llNobind.setVisibility(View.VISIBLE);
        }
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.top_back) {
            finish();
        } else if (view.getId() == R.id.btn_gotobind) {
//            Intent intent = new Intent(this, BankListActivity.class);
            Intent intent = new Intent(this, BankCard2Activity.class);
            startActivity(intent);
        }
    }

    private void initView() {
        topBack = (RelativeLayout) findViewById(R.id.top_back);
        topBack.setOnClickListener(BankCardActivity.this);
        topTitle = (TextView) findViewById(R.id.top_title);
        btnGotobind = (Button) findViewById(R.id.btn_gotobind);
        btnGotobind.setOnClickListener(BankCardActivity.this);
        llNobind = (LinearLayout) findViewById(R.id.ll_nobind);
        llBind = (LinearLayout) findViewById(R.id.ll_bind);
    }
}
